MarkLogic 9 Product Documentation
PUT /manage/v2/query-rolesets/{id|name}/properties

Summary

This resource endpoint updates a given query roleset using a name or id passed in the URL.

Request Headers
Accept The expected MIME type of the request body. If the format parameter is present, it takes precedence over the Accept header.
Content-type The MIME type of the data in the request body. Depending upon the value of the format parameter or Accept header, one of application/xml, application/json, or text/html.
Response Headers
Content-type The MIME type of the data in the response body. Depending upon the value of the format parameter or Accept header, one of application/xml, application/json, or text/html.

Response

A successful call to the endpoint will return 204 (No Content), the server successfully processed the request and is not returning any content.A response code of 400 (Bad Request) indicates that the query roleset does not exist or the payload is malformed. A status code of 401 (Unauthorized) is returned if the user does not have the necessary privileges for this action.

Consumes
application/json JSON Content
application/xml XML Content
Produces
application/json JSON Content
application/xml XML Content

Required Privileges

This operation requires the manage-admin role, or the following privilege:

http://marklogic.com/xdmp/privileges/manage

Usage Notes

The data in the request body should have the following structure.

query-roleset

A query roleset definition

This is a complex structure with the following children:

role-id

A role identifier (unique key).

role-name

The role-name.

Example


Assume the file properties.xml has the following contents:

<query-roleset-properties xmlns="http://marklogic.com/manage/query-roleset/properties">
  <query-roleset>
    <role-name>els-role-1</role-name>
    <role-name>els-role-2</role-name>
    <role-name>els-role-3</role-name>
  </query-roleset>
</query-roleset-properties>

curl --anyauth --user username:password -i -X PUT -H "Content-type: application/xml" \
  -d @./properties.xml \
  http://localhost:8002/manage/v2/query-rolesets/15465490467826729837/properties

==> MarkLogic returns a response similar to the following:

HTTP/1.1 204 No Content
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
    

Example


curl --anyauth --user username:password -i -X PUT -H "Content-type: application/json" \
  -d '{ "role-name": ["els-role-1", "els-role-2", "els-role-3" ] }' \
  http://localhost:8002/manage/v2/query-rolesets/15465490467826729837/properties

==> MarkLogic returns a response similar to the following:

HTTP/1.1 204 No Content
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy